package com.techsoul.module.tms.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.techsoul.common.core.pojo.vo.UserVo;
import com.techsoul.module.basic.pojo.vo.TBmLocationVo;
import com.techsoul.module.order.pojo.entity.PurchaseOrder;
import com.techsoul.module.order.pojo.entity.PurchaseOrderItem;
import com.techsoul.module.order.pojo.vo.PurchaseOrderVo;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialDeliveryLineVo;
import com.techsoul.module.pms.pojo.vo.TbWmsMaterialDeliveryVo;
import com.techsoul.module.tms.pojo.entity.*;
import com.techsoul.module.tms.pojo.param.CarrierSearchParam;
import com.techsoul.module.tms.pojo.param.DriverSearchParam;
import com.techsoul.module.tms.pojo.param.ExpressSaveParam;
import com.techsoul.module.tms.pojo.param.ExpressSearchParam;
import com.techsoul.module.tms.pojo.vo.CarrierVo;
import com.techsoul.module.tms.pojo.vo.DispatchImportOrderItemVo;
import com.techsoul.module.tms.pojo.vo.DriverVo;
import com.techsoul.module.tms.pojo.vo.ExpressVo;

import java.util.List;

/**
 * 物流信息 Service接口
 * 
 * @author liuen
 * @date 2021-01-26
 */
public interface IExpressService {

    /**
     * 新增
     * @param params
     * @return
     */
    String insert(ExpressSaveParam params);
    void genFreightOrderAndItem(List<TFoFreightOrder> orders, List<TFoFreightOrderItem> items, List<String> driverNos, String carrierNo, String frwarehouse,String toW,String routeType);
    void genFreightOrderAndItem(TFoFreightOrder order,  TFoFreightOrderItem item);

    void createDispatch(TFoFreightOrder order,  TFoFreightOrderItem item);
//    String importDataWithCarrier(MultipartFile file);
    String importDataWithCarrier(DispatchImportOrderItemVo data,PurchaseOrderItem ent,UserVo sysUser,Integer successNum,Integer failureNum );
    String importDataWithCarrier2(DispatchImportOrderItemVo data,PurchaseOrderItem ent,UserVo sysUser,String deliveryId);
    void insertItem(PurchaseOrderItem ent, String id, UserVo sysUser );
    String insertOrder(PurchaseOrderVo dataFromDb, PurchaseOrderItem save, UserVo sysUser );
    void genPurchaseOrderAndItem(PurchaseOrder order, PurchaseOrderItem item);
    void genPurchaseOrderAndItem(PurchaseOrder order, PurchaseOrderItem item, TbWmsMaterialDeliveryLineVo tbWmsMaterialDeliveryLineVo);
    String createVehicleRelocateDispatch
            (List<String> senddriver, List<TFoFreightOrderItem> dispatchItems, UserVo userVo,TBmLocationVo depart,TBmLocationVo dest,String carrierNo,String fr, String toW,String routeType);
    String callDriver(FreightVehicleDispatch freightVehicleDispatch,
                      List<FreightVehicleDistribution>  freightVehicleDistributions,
                      String mobile,TBmLocationVo depart,TBmLocationVo dest,UserVo userVo);
     void saveToExceptions(DispatchImportOrderItemVo data, PurchaseOrderItem ent,UserVo userVo);
    /**
     * 删除
     * @param id
     * @return
     */
    Integer delete(String id);

    /**
     * 批量删除
     * @param idList
     */
    Integer batchDelete(List<String> idList);

    /**
     * 修改
     * @param params
     * @return
     */
    Integer update(ExpressSaveParam params);

    /**
     * 详情
     * @param id
     * @return
     */
    ExpressVo findById(String id);

    /**
     * 列表
     * @param params
     * @return
     */
    List<ExpressVo> findAll(ExpressSearchParam params);
    IPage<DriverVo> driverSearch(DriverSearchParam params, Integer current, Integer pageSize);
    List<DriverVo> driverFindAll(DriverSearchParam params);
    /**
     * 列表-分页
     * @param params
     * @param current
     * @param pageSize
     * @return
     */
    IPage<ExpressVo> findAll(ExpressSearchParam params, Integer current, Integer pageSize);

    List<CarrierVo> carrierFindAll(CarrierSearchParam params);

    void createCustomer(iCustomer customer);
    iCustomer selectByCustomerId(String customerId);

}
